﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using APH.Parl2.Shared.Contracts;
using System.ServiceModel;
using System.Messaging;

namespace APH.Parl2.Business.Publishing
{
    public class PublishEventsClient : ClientBase<IPublishEvents>, IPublishEvents
    {
        static PublishEventsClient()
        {
            if (MessageQueue.Exists(@".\private$\PublishEventServiceQueue") == false)
            {
                MessageQueue.Create(@".\private$\PublishEventServiceQueue", true);
            }
        }

        public PublishEventsClient() { }

        public PublishEventsClient(string endpointConfigurationName) : base(endpointConfigurationName) { }

        public void OnPublished(Guid documentId)
        {
            Channel.OnPublished(documentId);
        }
    }
}
